1. Function to determine if a given year is a leap year


			
  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  'Name:  de_LeapYear
  '
  'Comments:
  '   Given a four-digit year, this function returns TRUE if the year is a Leap
  '   Year, FALSE if it is not
  '
  'In:    YYYY --> The four-digit year to check
  '
  'Out:   True if YYYY is a Leap Year
  '       False if YYYY is not a Leap Year
  '
  'Examples:
  '
  '       de_LeapYear(1996) returns True
  '
  '       de_LeapYear(1997) returns False
  '
  'Created: 09/02/98 by Stephen Negus
  '
  'Modifications:
  'Date           Author              Description
  '
  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  Function de_LeapYear(ByVal YYYY As Long) As Boolean
  On Error GoTo de_LeapYear_Err

      de_LeapYear = YYYY Mod 4 = 0 And (YYYY Mod 100 <> 0 Or YYYY Mod 400 = 0)

  de_LeapYear_Exit:
      Exit Function
    
  de_LeapYear_Err:
      Dim strMsg As String
      strMsg = "Error " & Err.Number & " has occurred."
      strMsg = strMsg & " The Description is: " & Err.Description
      MsgBox strMsg
      Resume de_LeapYear_Exit
    
  End Function
			

Copyright © 1999-2000, Doulos Enterprises
All Rights Reserved
Terms of Use